package com.littleHan.brushQuestions.utils;

public class SubStringUtil {

    /**
     * 截取user后 ::之前
     * @param keys
     * @return
     */
    public static String subStringRedisKeyFront(String keys) {
        String str1 = keys.substring(0, keys.indexOf(":"));
        String str2 = keys.substring(str1.length()+1);
        return str2.substring(0, str2.indexOf("::"));
    }

    /**
     * 截取user后 ::之后
     * @param keys
     * @return
     */
    public static String subStringRedisKeyAfter(String keys) {
        String str1 = keys.substring(0, keys.indexOf("::"));
        return keys.substring(str1.length()+2);
    }
}
